//
//  ResetCodeViewController.m
//  Socrates
//
//  Created by shy on 15/3/11.
//  Copyright (c) 2015年 shy. All rights reserved.
//

#import "ResetCodeViewController.h"

#import "RDVTabBarController.h"

typedef enum {
    kRigister_mobile_item = 0,
    kRigister_verify_code_item,
    kRigister_login_code_item,
    kRigister_login_code_verify_item,
} RigisterItems;

@interface ResetCodeViewController ()<UITextFieldDelegate> {
    UITextField *mobile_;
    UITextField *verifyCode_;
    UITextField *loginCode_;
    UITextField *loginVerify_;
    UIButton *next_;
}

@end

@implementation ResetCodeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithRed:239/255. green:239/255. blue:244/255. alpha:1.];
    CGFloat width = [UIScreen mainScreen].bounds.size.width;
    CGFloat topMargin = 90.;
    CGFloat gapHeight = 40.;
    CGFloat lineHeight = 1.;
    UIColor *lineColor = [UIColor colorWithRed:207/255. green:207/255. blue:207/255. alpha:0.8];
    UIView *separateLine = [[UIView alloc] initWithFrame:CGRectMake(0, topMargin, width, 1)];
    separateLine.backgroundColor = lineColor;
    [self.view addSubview:separateLine];
    mobile_ = [[UITextField alloc] initWithFrame:CGRectMake(20, topMargin, width - 40, gapHeight)];
    mobile_.placeholder = NSLocalizedString(@"$$$insert_register_number", nil);
    [self.view addSubview:mobile_];
    UIView *separateLineA = [[UIView alloc] initWithFrame:CGRectMake(20, topMargin + gapHeight, width - 40, lineHeight)];
    separateLineA.backgroundColor = lineColor;
    [self.view addSubview:separateLineA];
    
    verifyCode_ = [[UITextField alloc] initWithFrame:CGRectMake(20, topMargin + gapHeight, width - 40, gapHeight)];
    verifyCode_.placeholder = NSLocalizedString(@"$$$insert_code", nil);
    [self.view addSubview:verifyCode_];
    UIView *separateLineB = [[UIView alloc] initWithFrame:CGRectMake(20, topMargin + gapHeight*2, width - 40, lineHeight)];
    separateLineB.backgroundColor = lineColor;
    [self.view addSubview:separateLineB];
    
    loginCode_ = [[UITextField alloc] initWithFrame:CGRectMake(20, topMargin + gapHeight*2, width - 40, gapHeight)];
    loginCode_.placeholder = NSLocalizedString(@"$$$insert_new_code", nil);
    [self.view addSubview:loginCode_];
    UIView *separateLineC = [[UIView alloc] initWithFrame:CGRectMake(20, topMargin + gapHeight*3, width - 40, lineHeight)];
    separateLineC.backgroundColor = lineColor;
    [self.view addSubview:separateLineC];
    
    loginVerify_ = [[UITextField alloc] initWithFrame:CGRectMake(20, topMargin + gapHeight*3, width - 40, gapHeight)];
    loginVerify_.placeholder = NSLocalizedString(@"$$$confirm_password_again", nil);
    [self.view addSubview:loginVerify_];
    UIView *separateLineD = [[UIView alloc] initWithFrame:CGRectMake(0, topMargin + gapHeight*4, width, lineHeight)];
    separateLineD.backgroundColor = lineColor;
    [self.view addSubview:separateLineD];
    
    next_ = [[UIButton alloc] initWithFrame:CGRectMake((width - 120)/2, topMargin + gapHeight*4 + 45, 120, 35)];
    [next_ setImage:[UIImage imageNamed:@"next"] forState:UIControlStateNormal];
    [next_ addTarget:self action:@selector(clickNext) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:next_];
}

- (void)clickNext {
    NSLog(@"click next.");
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [[self rdv_tabBarController] setTabBarHidden:YES animated:NO];
}

- (void)viewWillDisappear:(BOOL)animated {
    //    [[self rdv_tabBarController] setTabBarHidden:NO animated:YES];
    
    [super viewWillDisappear:animated];
}

@end